package com.boco.blch.runner.command;

/**
 * 
 * @author akira
 *
 */
public class CommandImpl implements Command{
	private String command;
	
	public CommandImpl(String command){
		this.command = command;
		handler();
	}
	
	public CommandImpl(){}
	
	@Override
	public String getCommand() {
		return command;
	}
	@Override
	public void setCommand(String command) {
		this.command = command;
		handler();
	}
	
	/*将指令中的  ";" 替换成linux系统中的换行符 "\n",以及windows中的"\r\n"换成linux下的"\n"*/
	/* ";" 是为了给单行发送的多行指令提供一个可选的换行符*/
	private void handler(){
		command = command.replace(";", "\n").replace("\r\n", "\n");
	}
}